Jake Lazaroff shares his experience of creating Waypoint, a local-first web application designed for trip planning, after finding existing tools inadequate for his needs during a six-month travel sabbatical. The planning process was challenging, leading him to develop a solution that allows for quick data entry, easy comparisons, and the integration of unstructured data alongside structured data. Waypoint features a dual-panel interface with a text editor on one side and a map on the other, enabling users to jot down notes about potential destinations and visualize routes simultaneously. This design addresses the shortcomings of other tools, such as Apple Notes and Google Maps, which either lack flexibility in data entry or complicate the visualization of locations. The app allows users to create route lists easily, with the ability to toggle between driving directions and straight-line routes, enhancing the planning experience. The underlying technology of Waypoint is built using SvelteKit, with custom components from the Shoelace library and a rich text editor powered by ProseMirror. The app utilizes Stadia Maps for location services and employs Yjs, a CRDT library, for local data storage. This local-first approach means that data is stored on the client rather than a centralized server, allowing for instantaneous editing and offline functionality. The app also supports real-time collaboration through Y-Sweet, a WebSocket sync backend that facilitates document sharing and synchronization between users. Lazaroff discusses the principles of local-first software, emphasizing that the client should maintain the canonical copy of the data. He evaluates Waypoint against several criteria proposed by Ink & Switch, concluding that it meets most of the ideals of local-first software, with a few exceptions regarding security and privacy. Through this project, Lazaroff learned that building a local-first app is feasible with existing tools, and the integration of various libraries can create a seamless user experience. He highlights the ease of adding offline support and the overall developer experience as significant advantages of this architecture. The article concludes with an invitation to explore the code behind Waypoint on GitHub, encouraging others to engage with the local-first ecosystem.
Wednesday, October 2, 2024